<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href='##all.xsl#'/>
    <xsl:import href='##adminall.xsl#'/>
    <xsl:output method="html" indent="yes" encoding="UTF-8"/>

    <xsl:template match='content'>
        <xsl:apply-templates select='document("xcap://~self,cercea,$user?user.reg=1")' mode='admin.users.sub'/>
    </xsl:template>

    <xsl:template match="/" mode='admin.users.sub'>
        <div class='list'>
            <h1>Список пользователей</h1>
            <br/>
            <br />
            <ul id='admin-userslist'>
                <xsl:for-each select='//user'>
                    <xsl:if test="./name != ''">
                        <li>
                            <xsl:if test="./approved = 0 and position() mod 2 = 0">
                                <xsl:attribute name="class">hl unapproved tipped</xsl:attribute>
                                <xsl:attribute name='title'>Пользователь ожидает подтверждения регистрации</xsl:attribute>
                            </xsl:if>
                            <xsl:if test="./approved = 1 and position() mod 2 = 0">
                                <xsl:attribute name="class">hl</xsl:attribute>
                            </xsl:if>
                            <xsl:if test="./approved = 0 and position() mod 2 = 1">
                                <xsl:attribute name="class">unapproved tipped</xsl:attribute>
                                <xsl:attribute name='title'>Пользователь ожидает подтверждения регистрации</xsl:attribute>
                            </xsl:if>
                            <div>
                                <xsl:value-of select='./@id' />
                            </div>
                            <div>
                                <xsl:value-of select='./name' />
                            </div>
                            <div>
                                <xsl:value-of select='./email' />
                            </div>
                        </li>
                    </xsl:if>
                </xsl:for-each>
            </ul>
        </div>
    </xsl:template>
</xsl:stylesheet>